package com.glsc.ngateway.common.base.repo.mysql.opmanage.report;

import com.glsc.ngateway.common.base.domain.mysql.opmanage.report.FileUploadLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface FileUploadLogRepository extends JpaRepository<FileUploadLog, Long>, JpaSpecificationExecutor<FileUploadLog> {
    @Query(value = "select r from FileUploadLog r where r.id = :id")
    public FileUploadLog getById(@Param("id") String id);

    @Query(value = "select * from glsc_data.file_upload_log ful where ful.filename REGEXP :date",nativeQuery = true)
    public List<FileUploadLog> findByDateTime(@Param("date") String date);

    public List<FileUploadLog> getByIdIn(@Param("id") List<String> ids);
}
